package org.moflon.moca.vhdl.parser;
import java.io.IOException;
import java.io.Reader;
import org.antlr.runtime.ANTLRReaderStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.tree.CommonTree;
import org.moflon.moca.MocaUtil;
import Moca.parser.impl.ParserImpl;
import MocaTree.Node;

public class VhdlParserAdapter extends ParserImpl 
{

	@Override
	public boolean canParseFile(String fileName) 
	{
		return fileName.endsWith(".vhdl");
	}

	@Override
	public Node parse(Reader reader) 
	{
// TODO Uncomment this code
//		try 
//		{
//			VhdlLexer lexer = new VhdlLexer(new ANTLRReaderStream(reader));
//			CommonTokenStream tokens = new CommonTokenStream(lexer);
//			VhdlParser parser = new VhdlParser(tokens);
//			CommonTree result = (CommonTree) parser.main().tree; 
//			return MocaUtil.commonTreeToMocaTree(result);
//		} catch (IOException e) 
//		{
//			e.printStackTrace();
//		} catch (RecognitionException e) 
//		{
//			e.printStackTrace();
//		} 
		return null;
	}
}